home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Graphics / NXPlot3d / Source / DensView.h < prev    next >
Text File  |  1994-02-14  |  2KB  |  56 lines

  1. /* DensView.h  Copyright 1992 Steve Ludtke */
  2. /* This object does a density plot of a 3d data set */
  3.  
  4. /* Connect "delegate" to an object that can recieve "zoomTo:xmin :ymin :xmax */
  5. /* :ymax   messages (or leave it disconnected). Send setData::::: messages   */
  6. /* to pass data and render image. Send display messages to redisplay rendered*/
  7. /* image. */
  8.  
  9. #import <appkit/View.h>
  10.  
  11. #define DM_DENSITY    1
  12. #define DM_CONTOUR    2
  13. #define DM_MESH        4
  14. #define DM_DMESH    8
  15.  
  16. typedef struct { char *data; int n,al; } String;
  17.  
  18. @interface DensView:View
  19. {
  20. id delegate;    /* who to send -zoomTo messages to */
  21. id image;    /* image used to store the density plot */
  22. id tiffRes;        /* resolution for tiff saves */
  23. NXPoint point;    /* origin of image in view */
  24. NXSize size;    /* size of image */
  25. NXRect ticks;    /* Tick origin/spacing */
  26. float *data;    /* points to array of Z values to plot */
  27. String buf;        /* postscript command buffer */
  28. int nx,ny;    /* number of data points = nx*ny */
  29. float Zlim[4]; /* used to determine max and min brightness */
  30. NXRect rec,rec2;    /* rec=limits of data, rec2=limits of "real" data */
  31. char mode,dmode;
  32. float lev0,lev1;    /* contour start and spacing */
  33. }
  34.  
  35. /* initialization */
  36. -initFrame:(NXRect *)myrect;
  37. /* composites the image to the screen */
  38. -drawSelf:(NXRect *)rects :(int)rectCount;
  39. /* resize the view */
  40. -superviewSizeChanged:(const NXSize *)oldsize;
  41. /* allows user to select zoom area */
  42. -mouseDown:(NXEvent *)oevent;
  43. -(int)acceptsFirstMouse;
  44.  
  45. /* This routine passes the actual data to be plotted to the DensView */
  46. /* It also does all of the actual drawing (into an Image) */
  47. -setData:(int)Nx :(int)Ny :(float *)Data :(float *)Zlim :(NXRect)Ticks :(NXRect)rec :(NXRect)rec2 :(float)Lev0 :(float)Lev1;
  48.  
  49. -setDenFlag:sender;
  50.  
  51. -saveTiff:sender;
  52. -savePS:sender;
  53. -printPSCode:sender;
  54. @end
  55.  
  56.